package com.seanliao.nav.common.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 权限VO
 *
 * @author Sean_Liao
 */
@Data
//@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PermissionVO implements Comparable<PermissionVO> {

    /* 权限id */
    private Long id;

    /* 父级权限id */
    private Long pid;

    /* 权限名称 */
    private String name;

    /* 权限值 */
    private String code;

    /*图标*/
    private String icon;

    /* 权限类型 */
    private Integer type;

    /* 前端资源路径 */
    private String uri;

    /* 是否被禁用 */
    private Boolean isBan;

    /* 创建时间 */
    private LocalDateTime createTime;

    /* 排序 */
    private Integer sort;

    /* 子权限列表 */
    private List<PermissionVO> childPermission;

    @Override
    public int compareTo(@NotNull PermissionVO o) {
        return this.getSort() - o.getSort();
    }
}
